package org.meerkat.forum.client.threadview;

import com.extjs.gxt.ui.client.event.IconButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.button.ToolButton;
import com.google.gwt.user.client.ui.Label;

public class ThreadView extends ContentPanel {
	private class CloseClickHandler extends SelectionListener<IconButtonEvent> {
		@Override
		public void componentSelected(IconButtonEvent ce) {
			removeFromParent();
		}
	}

	private class MinimizeClickHandler extends SelectionListener<IconButtonEvent> {
		@Override
		public void componentSelected(IconButtonEvent ce) {
			Info.display("Click", "Minimize");
		}
	}

	public ThreadView() {
		setHeaderVisible(true);
		head.addTool(new ToolButton("x-tool-minimize", new MinimizeClickHandler()));
		head.addTool(new ToolButton("x-tool-close", new CloseClickHandler()));
		add(new Label("Message 1"));
		add(new Label("Message 2"));
	}
}
